//
//  MTMaskView.m
//  ShiShiBang
//
//  Created by 宋宝强 on 16/9/25.
//  Copyright © 2016年 motianjituan. All rights reserved.
//

#import "MTMaskView.h"
#import "MTPickerTimeView.h"




@implementation MTMaskView

+ (instancetype)show{
    
    
    MTMaskView *maskView = [[MTMaskView alloc] init];
    
    maskView.frame = [UIScreen mainScreen].bounds;
    maskView.backgroundColor = [UIColor blackColor];
    maskView.alpha = 0.3;
    
    [mainWindow addSubview:maskView];
    return maskView;
    
}

+ (void)hidden{
    
    for (MTMaskView *view  in mainWindow.subviews) {
        if ([view isKindOfClass:[MTMaskView class]]) {
            [view removeFromSuperview];
        }
    }
    
    
}




- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    [MTPickerTimeView setHiddenPickerTimeView:^{
        [MTMaskView hidden];
    }];

}




@end
